package com.it.emall.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * 用户收藏Mapper
 */
@Mapper
public interface UserFavoritesMapper {

    @Select("SELECT recipe_id, COUNT(*) FROM user_favorites WHERE user_id = #{userId} GROUP BY recipe_id")
    Map<Integer, Integer> findFavoritedRecipeIdsByUserId(int userId);
}
